package com.gz.common.mongodb.service.impl;

import com.gz.common.mongodb.service.MongoTestService;
import com.gz.common.mongodb.dao.MongoTestMapper;
import com.gz.common.mongodb.entity.MongoTest;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName MongoTestServiceImpl
 * @Description //
 * @Author WHX
 * @Date 2021/9/19 21:08
 **/
@Service
public class MongoTestServiceImpl implements MongoTestService {
    @Resource
    private MongoTestMapper mongoTestMapper;

    /**
     * 插入一条数据
     *
     * @param mongoTest
     */
    @Override
    public void insert(MongoTest mongoTest) {
        mongoTestMapper.insert(mongoTest);
    }

    /**
     * 查询所有数据
     *
     * @return
     */
    @Override
    public List<MongoTest> findAll() {
        return mongoTestMapper.findAll();
    }

    /**
     * 删除所有数据
     */
    @Override
    public void deleteAll() {
        mongoTestMapper.deleteAll();
    }
}
